/* Copyright  2009
   @Author
   Richard Changde Yin            e-mail yinchangde@hotmail.com

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; version 2 of the License.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */

/**
 * @filename: user_var_entry.h
 */

#ifndef __USER_VAR_ENTRY_H__
#define __USER_VAR_ENTRY_H__


// this is needed for user_vars hash
class user_var_entry
{
public:

  user_var_entry() {}                         /* Remove gcc warning */

  virtual ~user_var_entry(){}                 /* Remove gcc warning */

  LEX_STRING name;

  char *    value;
  ulong    length;

  query_id_t update_query_id;

  query_id_t used_query_id  ;

  Item_result type;

  bool unsigned_flag;

  double val_real(bool *null_value);

  int64_t val_int(bool *null_value) const;

  String *val_str(bool *null_value, String *str, uint32_t decimals);

  db_decimal *  val_decimal  (bool *null_value, db_decimal *result);

  DTCollation collation;
};

#endif /* __USER_VAR_ENTRY_H__ */
